const arr = [1, 2, 3];
const sum = arr.reduce((acc, cur) => acc + cur, 0);
// 结果：6